<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:p="http://primefaces.prime.com.tr/ui">

	<p:panel header="#{msg.meuInbox}">
		<h:form id="idMeuInboxMBForm">
				<h:commandLink value="#{msg.botaoAtualizarTela}">
					<a4j:support reRender="inboxList" event="onclick"/>
				</h:commandLink>
				<rich:spacer width="2px"/> | <rich:spacer width="3px"/>
				<h:commandLink value="#{msg.botaoCriarOcorrencia}"
				onclick="javascript:window.open('','nomeCriarOcorrencia','height=600,width=680,top=80,left=250,toolbar=no,scrollbars=no')"
				target="nomeCriarOcorrencia" action="criarOcorrenciaMBForm"/>
				<p:dataTable id="inboxList" var="inbox" value="#{inboxesMB.meuInboxList}" paginator="true" rows="20" 
					selection="#{inboxesMB.inboxSelectedList}" selectionMode="multiple">
					<p:column sortBy="#{inbox.codigo}" filterBy="#{inbox.codigo}">
						<f:facet name="header">
							<h:outputText value="#{msg.codigo}" />
						</f:facet>
						<h:outputText value="#{inbox.codigo}" />
					</p:column>
					<p:column filterBy="#{inbox.titulo}" sortBy="#{inbox.titulo}">
						<f:facet name="header">
							<h:outputText value="#{msg.titulo}" />
						</f:facet>
						<h:outputText value="#{inbox.titulo}" />
					</p:column>
					<p:column filterBy="#{inbox.status.nome}" sortBy="#{inbox.status.nome}">
						<f:facet name="header">
							<h:outputText value="#{msg.status}" />
						</f:facet>
						<h:outputText value="#{inbox.status.nome}" rendered="#{inbox.atrasado}" style="font-weight: bold; color:red; font-size: 10px;"/>
						<h:outputText value="#{inbox.status.nome}" rendered="#{!inbox.atrasado}" style="font-weight: bold; font-size: 10px;"/>
					</p:column>
					<p:column sortBy="#{inbox.dataCriacao}" filterBy="#{inbox.dataCriacao}">
						<f:facet name="header">
							<h:outputText value="#{msg.dataInicio}" />
						</f:facet>
						<h:outputText value="#{inbox.dataCriacao}">
							<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
						</h:outputText>
					</p:column>
					<p:column filterBy="#{inbox.dataConclusao}" sortBy="#{inbox.dataConclusao}">
						<f:facet name="header">
							<h:outputText value="#{msg.dataConclusao}" />
						</f:facet>
						<h:outputText value="#{inbox.dataConclusao}">
							<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
						</h:outputText>
					</p:column>					
					<p:column filterBy="#{inbox.pessoaSolicitante.nome}" sortBy="#{inbox.pessoaSolicitante.nome}">
						<f:facet name="header">
							<h:outputText value="#{msg.solicitante}" />
						</f:facet>
						<h:outputText value="#{inbox.pessoaSolicitante.nome}" />
					</p:column>
					<p:column filterBy="#{inbox.pessoaResponsavel.nome}" sortBy="#{inbox.pessoaResponsavel.nome}">
						<f:facet name="header">
							<h:outputText value="#{msg.responsavel}" />
						</f:facet>
						<h:outputText value="#{inbox.pessoaResponsavel.nome}" />
					</p:column>
				</p:dataTable>
				<h:outputText value="#{msg.exportarTodosDados}" style="font-weight:bold"/>:
				<h:commandLink>
					<p:graphicImage value="/images/excel.png" style="border:0;"/>
					<p:dataExporter type="xls" target="inboxList" fileName="#{msg.inboxGeral}" />
				</h:commandLink>
				<h:commandLink>
					<p:graphicImage value="/images/pdf.png" style="border:0;"/>
					<p:dataExporter type="pdf" target="inboxList" fileName="#{msg.inboxGeral}"/>
				</h:commandLink><rich:spacer width="10px"/>
		
				<h:outputText value="#{msg.exportarDadosPagina}" style="font-weight:bold"/>:
				<h:commandLink>
					<p:graphicImage value="/images/excel.png" style="border:0;"/>
					<p:dataExporter type="xls" target="inboxList" fileName="#{msg.inboxGeral}" />
				</h:commandLink>
				<h:commandLink>
					<p:graphicImage value="/images/pdf.png" style="border:0;"/>
					<p:dataExporter type="pdf" target="inboxList" fileName="#{msg.inboxGeral}"/>
				</h:commandLink>			
		</h:form>
	</p:panel>
</ui:composition>